package com.xj.listener;

import com.xj.config.SendTenXunYunSmsUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

// 同步消费
@Service
@RocketMQMessageListener(
        topic = "sync",
        consumerGroup = "group-sync")
@Slf4j
public class SyncListener implements RocketMQListener<String> {

    @Autowired
    SendTenXunYunSmsUtil smsUtil;
    @Override
    public void onMessage(String s) {
        smsUtil.send(s);

        log.info("sync消费者:  传过来的消息是 =={} ",s);
    }




}